//
//  CharacterFactory.m
//  PacIsBack
//
//  Created by Simon André on 09/02/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "CharacterFactory.h"
#import "CharacterProtocol.h"
#import "PlayerCharacter.h"


@implementation CharacterFactory

+(id<CharacterProtocol>) createCharacterWithType:(NSString*) type{
	PlayerCharacter* charact = [[PlayerCharacter alloc] initWithType:type];
	if ([type compare:@"Madakia"]==NSOrderedSame) {
		[charact setLevel:1];
		[charact setMaxHP:2000];
		[charact setCurrentHP:2000];
		[charact setMaxMP:200];
		[charact setCurrentMP:200];
		[charact setCurrentXP:0];
		[charact setStrength:30];
		[charact setAgility:15];
		[charact setVitality:20];
		[charact setDefense:10];
		[charact setIntelligence:25];
		[charact setWisdom:15];
		[charact setSpeed:25];
		[charact setLuck:5];
		[charact setExperienceReward:0];
	}
	else if ([type compare:@"Mummy"]==NSOrderedSame) {
		[charact setLevel:1];
		[charact setMaxHP:500];
		[charact setCurrentHP:500];
		[charact setMaxMP:0];
		[charact setCurrentMP:0];
		[charact setCurrentXP:0];
		[charact setStrength:10];
		[charact setAgility:2];
		[charact setVitality:4];
		[charact setDefense:2];
		[charact setIntelligence:1];
		[charact setWisdom:1];
		[charact setSpeed:5];
		[charact setLuck:10];
		[charact setExperienceReward:10];
	}
	else if ([type compare:@"Pharaoh"]==NSOrderedSame) {
		[charact setLevel:1];
		[charact setMaxHP:2000];
		[charact setCurrentHP:2000];
		[charact setMaxMP:0];
		[charact setCurrentMP:0];
		[charact setCurrentXP:0];
		[charact setStrength:20];
		[charact setAgility:3];
		[charact setVitality:2];
		[charact setDefense:1];
		[charact setIntelligence:1];
		[charact setWisdom:1];
		[charact setSpeed:3];
		[charact setLuck:1];
		[charact setExperienceReward:1000];
	}
	[charact recreateBattleController];
	[charact autorelease];
	return charact;
}

@end
